package com.wangs;

import java.util.List;
import java.util.ArrayList;

import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IEditorInput;

public class EntityElement implements ITreeElement {

	private String name;
	private int level;
	private IEditorInput editorInput;
	private List childList = new ArrayList();
	public String ID;
	public Composite composite;
	
	public EntityElement() {
		
	}
//	public EntityElement(String name) {
//		this.name = name;
//	}
	
	public EntityElement(String name, int level){
		this.name = name;
		this.level = level;
	}
	
	@Override
	public void setName(String name) {
		// TODO Auto-generated method stub
		this.name = name;
	}

	@Override
	public String getName() {
		// TODO Auto-generated method stub
		return name;
	}
	public int getLevel() {
		return level;
	}
	public void setLevel(int level) {
		this.level = level;
	}
	@Override
	public void setChildren(List children) {
		// TODO Auto-generated method stub
		this.childList = children;
	}

	@Override
	public List getChildren() {
		// TODO Auto-generated method stub
		return childList;
	}

	@Override
	public boolean hasChildren() {
		// TODO Auto-generated method stub
		if (childList.size()>0) {
			return true;
		} else {
			return false;
		}
		
	}

	@Override
	public void addChild(ITreeElement treeElement) {
		// TODO Auto-generated method stub
		childList.add(treeElement);
	}
	
	public IEditorInput getEditorInput() {
		return editorInput;
	}
	public void setEditorInput(IEditorInput editorInput) {
		this.editorInput = editorInput;		
	}

}
